package de.tuhh.simsearch.dto;

import java.io.Serializable;
import java.util.Set;

import javax.xml.bind.annotation.XmlRootElement;

/**
 * The PreferenceDTO is the data transfer object for a preference entity. The dto contains the content type in the
 * string representation, the preference name, the list of preference subscriber's names.
 * 
 * @author SimSearch 1
 * 
 */
@XmlRootElement(name = "preference")
public class PreferenceDTO implements Serializable {

  private static final long serialVersionUID = 6161184718364162248L;

  private String contentType;

  private String name;

  private Set<String> preferenceSubscriber;

  /**
   * Default class constructor
   */
  public PreferenceDTO() {

  }

  /**
   * Generates a new preference dto which already has a certain content type and a name
   * 
   * @param contentType
   *          the content type in string representation
   * @param name
   *          the preference name
   */
  public PreferenceDTO(String contentType, String name) {

    this.name = name;
    this.contentType = contentType;
  }

  /**
   * Gets the content type
   * 
   * @return the content type in string representation
   */
  public String getContentType() {

    return contentType;
  }

  /**
   * Sets the content type
   * 
   * @param contentType
   *          the content type in string representation
   */
  public void setContentType(String contentType) {

    this.contentType = contentType;
  }

  /**
   * Gets the name of the preference
   * 
   * @return the name of the preference
   */
  public String getName() {

    return name;
  }

  /**
   * Sets the name of the preference
   * 
   * @param name
   *          the name of the preference
   */
  public void setName(String name) {

    this.name = name;
  }

  /**
   * Gets the set of preference subscribers' names
   * 
   * @return the set of preference subscribers
   */
  public Set<String> getPreferenceSubscriber() {

    return preferenceSubscriber;
  }

  /**
   * Sets preference subscribers
   * 
   * @param preferenceSubscriber
   *          the set of names of preference subscribers.
   */
  public void setPreferenceSubscriber(Set<String> preferenceSubscriber) {

    this.preferenceSubscriber = preferenceSubscriber;
  }

}
